(: Converts attractionsByNames into attractionsByCity :)

<attractions>{
for $cities in distinct-values(doc("attractionsByNames.xml")/attractions/attraction/city)
order by $cities
return <city name="{$cities}">
    {for $attrInCity in doc("attractionsByNames.xml")/attractions/attraction[city=$cities]
    order by $attrInCity/name
    return <attraction type="{$attrInCity/@type}">{$attrInCity/name}{$attrInCity/street}
        </attraction>}
</city>}
</attractions>